<template>
	<view>
		<view class="ulist">
			<view class="item" v-for="(item,index) in ulist" :key="index" @click="pagego(item,index)">
				<view class="flex_b">
					<image :src="item.icon" mode=""></image>
					<view class="flex_b">
						<view class="">
							{{item.uname}}
						</view>
					</view>
				</view>
				<image class="rig" src="/static/icon/r.png" mode=""></image>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				ulist: [{
						uname: '关注公众号',
						icon: require('../../static/icon/l1.png'),
						path: '/mypage/contactus/gzgzhong'
					},
					{
						uname: '加入我们',
						icon: require('../../static/icon/l2.png'),
						path: '/mypage/contactus/joinwe'
					},
					{
						uname: '意见反馈',
						icon: require('../../static/icon/l3.png'),
						path: '/mypage/contactus/opinion'
					},
					{
						uname: '常见问题',
						icon: require('../../static/icon/l4.png'),
						path: '/mypage/contactus/question'
					},
					{
						uname: '关于我们',
						icon: require('../../static/icon/l5.png'),
						path: '/mypage/contactus/useragreement?id=1'
					},
					{
						uname: '隐私政策',
						icon: require('../../static/icon/l6.png'),
						path: '/mypage/contactus/useragreement?id=3'
					},
					{
						uname: '用户协议',
						icon: require('../../static/icon/l6.png'),
						path: '/mypage/contactus/useragreement?id=2'
					}
				]
			};
		},
		methods:{
			pagego(item,index){
				if(index== 2){
					if (uni.getStorageSync('userToken')) {
						uni.navigateTo({
							url:item.path
						})
					} else {
						uni.navigateTo({
							url: '/pages/login/login'
						})
					}
				}else{
					uni.navigateTo({
						url:item.path
					})
				}
				
			}
		}
	}
</script>

<style lang="scss">
	page {
		background: #FBFBFB;
	}

	.ulist {
		background: #fff;
		padding: 0rpx 20rpx 0rpx 0rpx;
		box-sizing: border-box;
		.item {
			display: flex;
			justify-content: space-between;
			align-items: center;
			font-family: PingFang SC, PingFang SC;
			font-weight: bold;
			font-size: 28rpx;
			color: #000000;
			margin-bottom: 28rpx;
			image {
				width: 80rpx;
				height: 80rpx;
			}

			.rig {
				width: 40rpx;
				height: 40rpx;
			}
		}
	}
</style>